package com.ruoyi.community.service.impl;

import java.util.List;

import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.community.domain.BbsPunish;
import com.ruoyi.community.mapper.BbsPunishMapper;
import com.ruoyi.community.service.IBbsPunishService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 社区惩罚Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-08-16
 */
@Service
public class BbsPunishServiceImpl implements IBbsPunishService
{
    @Autowired
    private BbsPunishMapper bbsPunishMapper;

    /**
     * 查询社区惩罚
     * 
     * @param id 社区惩罚ID
     * @return 社区惩罚
     */
    @Override
    public BbsPunish selectBbsPunishById(Long id)
    {
        return bbsPunishMapper.selectBbsPunishById(id);
    }

    /**
     * 查询社区惩罚列表
     * 
     * @param bbsPunish 社区惩罚
     * @return 社区惩罚
     */
    @Override
    public List<BbsPunish> selectBbsPunishList(BbsPunish bbsPunish)
    {
        return bbsPunishMapper.selectBbsPunishList(bbsPunish);
    }

    /**
     * 新增社区惩罚
     * 
     * @param bbsPunish 社区惩罚
     * @return 结果
     */
    @Override
    public int insertBbsPunish(BbsPunish bbsPunish)
    {
        long userid = SecurityUtils.getUserID();
        bbsPunish.setOperatorid(userid);
        return bbsPunishMapper.insertBbsPunish(bbsPunish);
    }

    /**
     * 修改社区惩罚
     * 
     * @param bbsPunish 社区惩罚
     * @return 结果
     */
    @Override
    public int updateBbsPunish(BbsPunish bbsPunish)
    {
        return bbsPunishMapper.updateBbsPunish(bbsPunish);
    }

    /**
     * 批量删除社区惩罚
     * 
     * @param ids 需要删除的社区惩罚ID
     * @return 结果
     */
    @Override
    public int deleteBbsPunishByIds(Long[] ids)
    {
        return bbsPunishMapper.deleteBbsPunishByIds(ids);
    }

    /**
     * 删除社区惩罚信息
     * 
     * @param id 社区惩罚ID
     * @return 结果
     */
    @Override
    public int deleteBbsPunishById(Long id)
    {

        return bbsPunishMapper.deleteBbsPunishById(id);
    }

    @Override
    public String isPunish(Long id) {
        return bbsPunishMapper.isPunish(id);
    }

}
